<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*变量提升*/
    console.log(num) // undefined
    var num = 10

    /*可以不使用关键字*/
    str = 10
    console.log(str)

    /*可以重复声明*/
    var a = 20
    var a = 30
    console.log(a)//30

    /*没有块级作用域*/
    if (true){
        var res=20
    }
    console.log(res)
    {
        var user={}
    }
    console.log(user)
</script>
</body>
</html>